(() => {
    // 继承：类与类之间的关系
    class Person {
        name: string
        age: number
        gender: string

        constructor(name: string, age: number, gender: string) {
            this.name = name
            this.age = age
            this.gender = gender
        }

        sayHi(str: string) {
            console.log(`我是${this.name}`, str)
        }
    }

    class Student extends Person {
        constructor(name: string, age: number, gender: string) {
            super(name, age, gender)
        }
    }

    const student = new Student('小甜甜', 18, '男')
    student.sayHi('你叫什么')
})()